<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<?
  require_once('../controller/facebook_sdk/facebook.php');

  $config = array(
    'appId' => '314860265232330',
    'secret' => 'de61791ac4eec6920ab83856c90b7861',
  );
	try{
		$facebook = new Facebook($config);
		$user_id = $facebook->getUser();		
		$user = $facebook->getUser();
		$user_profile = $facebook->api('/me');
		}catch (FacebookApiException $e){
		include "../controller/header_controller.php";
		}
		

		  ?>
<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link rel="stylesheet" type="text/css" href="CSS/header_form.css" />
	</head>
	<body>
		<div class="link">
			<h2><a href ="main.html" name = "home" target="main"><img src ="css/image/Logo_1.png" /></a>
		</div>
		<div class="index">
		<form action="product.html" enctype="multipart/form-data" target="main" method="get">
			<input type="text"   name="product_name"  size="30"><input type="submit"  value="검색"></h2>
			</form>
		</div>
		<div class="FB_login">
		  <a href= "<?echo $user_profile['link']?>" target ="_top" id ="fb_set" >
		  <?if($user == null){}
		  else
		  {?>
		  <img src="https://graph.facebook.com/<?php echo $user; ?>/picture" id ='fb_img'>
		  <?}
		  echo $user_profile['name'];?>
		  </a>
		</div>
	</body>
</html>